Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favor methods over closure fields #37

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

GuillaumeGomez
Copy link
Contributor

Very surprisingly, we can't call methods directly, however closures (which are fields) can be called. I don't think this incentive makes sense as methods are much more common than closures as fields. Also, it now follows the rust syntax way.

@GuillaumeGomez
Copy link
Contributor Author

Hopefully, not too many fixes like this should follow, still working on switching docs.rs from tera. :3

@Kijewski
Copy link
Collaborator

Kijewski commented Jul 2, 2024

To call a function in the current scope, you have to call {{ self::function(args) }} then, don't you? Maybe you could add a test to ensure this syntax works, and maybe mention it in the book?

@GuillaumeGomez
Copy link
Contributor Author

Should be the same as the current situation but having more tests is always a good idea!

@GuillaumeGomez
Copy link
Contributor Author

Added test and updated docs (which were not mentioning functions surprisingly).

Copy link
Collaborator

@Kijewski Kijewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Kijewski Kijewski merged commit ca85ef6 into rinja-rs:master Jul 2, 2024
17 checks passed
@GuillaumeGomez GuillaumeGomez deleted the method-call branch July 2, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants